<template>
  <el-form-item :label="label" :prop="prop">
    <el-input v-model="inputVal" :maxlength="maxlength" @input="upDateValue" />
  </el-form-item>
</template>

<script>
export default {
  name: '',
  components: {},
  props: {
    label: {
      type: String,
      default: ''
    },
    prop: {
      type: String,
      default: ''
    },
    value: {
      type: String,
      default: ''
    },
    maxlength: {
      type: Number,
      default: 20
    }
  },
  data() {
    return {
      inputVal: ''
    }
  },
  created() {
    this.inputVal = this.value
  },
  mounted() {},
  methods: {
    upDateValue(val) {
      this.$emit('update:value', val)
      this.$emit('change', val)
    }
  }
}
</script>

<style lang="less" scoped>

</style>
